package es.unex.meigas.dataObjects;


public interface IInputFactory {

	/**
	 * Creates the data objects
	 */
	public void createDataObjects();

	/**
	 * Clears the set of data objects
	 */
	public void clearDataObjects();

	/**
	 * Returns all objects in the set(layers and tables)
	 * @return all objects in the set(layers and tables)
	 */
	public IDataObject[] getDataObjects();


	/**
	 * Adds a new data object to the ones already existing.
	 * This method should be called from post-process tasks,
	 * to incorporate output object to the inputs list without
	 * having to create all the already existing objects again
	 * @param obj the data object to add
	 */
	public void addDataObject(IDataObject obj);

	/**
	 * Returns the raster layers in the set
	 * @return an array of raster layers
	 */
	public IRasterLayer[] getRasterLayers();

	/**
	 * Returns all the vector layers of a particular type
	 * currently in the set
	 * @param shapeType The type of vector layer. Use the constants
	 * defined in @see {@link IVectorLayer}
	 * @return an array of vector layers
	 */
	public IVectorLayer[] getVectorLayers(int shapeType);

	/**
	 * Returns the tables in the set
	 * @return an array of tables
	 */
	public ITable[] getTables();

	/**
	 * Returns al the individual bands of the
	 * raster layers in the set
	 * @return an array of bands
	 */
	public RasterLayerAndBand[] getBands();

	/**
	 * Returns the raster and vectorlayers in the set
	 * @return an array of layers
	 */
	public ILayer[] getLayers();

	/**
	 * Returns an input object based on its name
	 * @return the input object corresponding to the specified name.
	 * Returns null if no object with that name was found
	 */
	public IDataObject getInputFromName(String value);

	/**
	 * Returns an array of extensions that this InputFactory supports
	 * for opening raster layers
	 * @return the supported extensions for raster layers
	 */
	public abstract String[] getRasterLayerInputExtensions();

	/**
	 * Returns an array of extensions that this InputFactory supports
	 * for opening vector layers
	 * @return the supported extensions for vector layers
	 */
	public abstract String[] getVectorLayerInputExtensions();

	/**
	 * Returns an array of extensions that this InputFactory supports
	 * for opening tables
	 * @return the supported extensions for tables
	 */
	public abstract String[] getTableInputExtensions();

	/**
	 * Returns a data object created from the specified filename
	 * @param filename the filename
	 * @return a data object. null if could not create it from the
	 * specified file
	 */
	public IDataObject openDataObjectFromFile(String filename);

	/**
	 * adds a data object to the GIS
	 * @param obj the object to add (the layer)
	 */
	public void addDataObjectToGIS(IDataObject obj);

}
